/*
 * Application_Map.c
 *
 *  Created on: 2023年3月24日
 *      Author: mzy2364
 */



/*******************************************************************************
* include files                                                 
*******************************************************************************/
#include "Application_Define.h"

/*******************************************************************************
* Defines                                                                
*******************************************************************************/

/*******************************************************************************
* Macros                                                                
*******************************************************************************/

/*******************************************************************************
* Global Constant definition                         
*******************************************************************************/

/*******************************************************************************
* Local Constant definition                         
*******************************************************************************/

/*******************************************************************************
* Global Variables definition                         
*******************************************************************************/

/* Control map containing angle to start fuel pulse (16bit) */
const uint16_t Fuel_Pulse_Angle_Map[FUEL_RPM_POINTS][FUEL_LOAD_POINTS] =
{
/* RPM -------------------------------------------------------->             */
{0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0},
       /*   v   */ 
};

uint16_t Fuel_Load_Map_Values[FUEL_LOAD_POINTS] =
{
0,2,5,10,15,20,25,30,40,60,80,100
};

uint16_t Fuel_RPM_Map_Values[FUEL_RPM_POINTS] =
{
1500,
1750,
2000,
2250,
2500,
2750,
3000,
3250,
3500,
3750,
4000,
4250,
4500,
4750,
5000,
5250,
5500,
5750,
6000,
6250,
6500,
6750,
7000,
7250,
7500,
7750,
8000,
8250,
8500,
8750,
9000
};

/* Control map containing fuel pulse width (16bit) */
const uint32_t Fuel_Pulse_Width_Map[FUEL_RPM_POINTS][FUEL_LOAD_POINTS] =
{
/* RPM| LOAD -------------------------------------------------------->             */
{3750,3824,3900,3978,4058,4140,4222,4306,4392,4480,4570,4662},
{3824,3900,3978,4058,4140,4222,4306,4392,4480,4570,4662,4754},
{3900,3978,4058,4140,4222,4306,4392,4480,4570,4662,4754,4850},
{3978,4058,4140,4222,4306,4392,4480,4570,4662,4754,4850,4948},
{4058,4140,4222,4306,4392,4480,4570,4662,4754,4850,4948,5046},
{4140,4222,4306,4392,4480,4570,4662,4754,4850,4948,5046,5146},
{4222,4306,4392,4480,4570,4662,4754,4850,4948,5046,5146,5250},
{4306,4392,4480,4570,4662,4754,4850,4948,5046,5146,5250,5354},
{4392,4480,4570,4662,4754,4850,4948,5046,5146,5250,5354,5462},
{4480,4570,4662,4754,4850,4948,5046,5146,5250,5354,5462,5572},
{4570,4662,4754,4850,4948,5046,5146,5250,5354,5462,5572,5682},
{4662,4754,4850,4948,5046,5146,5250,5354,5462,5572,5682,5796},
{4754,4850,4948,5046,5146,5250,5354,5462,5572,5682,5796,5912},
{4850,4948,5046,5146,5250,5354,5462,5572,5682,5796,5912,6030},
{4948,5046,5146,5250,5354,5462,5572,5682,5796,5912,6030,6152},
{5046,5146,5250,5354,5462,5572,5682,5796,5912,6030,6152,6274},
{5146,5250,5354,5462,5572,5682,5796,5912,6030,6152,6274,6400},
{5250,5354,5462,5572,5682,5796,5912,6030,6152,6274,6400,6528},
{5354,5462,5572,5682,5796,5912,6030,6152,6274,6400,6528,6658},
{5462,5572,5682,5796,5912,6030,6152,6274,6400,6528,6658,6792},
{5572,5682,5796,5912,6030,6152,6274,6400,6528,6658,6792,6928},
{5682,5796,5912,6030,6152,6274,6400,6528,6658,6792,6928,7066},
{5796,5912,6030,6152,6274,6400,6528,6658,6792,6928,7066,7208},
{5912,6030,6152,6274,6400,6528,6658,6792,6928,7066,7208,7352},
{6030,6152,6274,6400,6528,6658,6792,6928,7066,7208,7352,7498},
{6152,6274,6400,6528,6658,6792,6928,7066,7208,7352,7498,7648},
{6274,6400,6528,6658,6792,6928,7066,7208,7352,7498,7648,7802},
{6400,6528,6658,6792,6928,7066,7208,7352,7498,7648,7802,7958},
{6528,6658,6792,6928,7066,7208,7352,7498,7648,7802,7958,8116},
{6658,6792,6928,7066,7208,7352,7498,7648,7802,7958,8116,8280},
{6792,6928,7066,7208,7352,7498,7648,7802,7958,8116,8280,8444}
};



uint16_t Spark_Load_Map_Values[SPARK_LOAD_POINTS] =
{
10,20,50,100
};


uint16_t Spark_RPM_Map_Values[SPARK_RPM_POINTS] =
{
1500,
1750,
2000,
2250,
2500,
2750,
3000,
3250,
3500,
3750,
4000,
4250,
4500,
4750,
5000,
5250,
5500,
5750,
6000,
6250,
6500,
6750,
7000,
7250,
7500,
7750,
8000,
8250,
8500,
8750,
9000
};

const uint16_t Spark_Timing_Map[SPARK_RPM_POINTS][SPARK_LOAD_POINTS] =
{
{0,0,0,0},
{0,0,0,0},
{0,0,0,0},
{0,0,0,0},
{0,0,0,0},
{0,0,0,0},
{0,0,0,0},
{0,0,0,0},
{0,0,0,0},
{0,0,0,0},
{0,0,0,0},
{0,0,0,0},
{0,0,0,0},
{0,0,0,0},
{0,0,0,0},
{0,0,0,0},
{0,0,0,0},
{0,0,0,0},
{0,0,0,0},
{0,0,0,0},
{0,0,0,0},
{0,0,0,0},
{0,0,0,0},
{0,0,0,0},
{0,0,0,0},
{0,0,0,0},
{0,0,0,0},
{0,0,0,0},
{0,0,0,0},
{0,0,0,0},
{0,0,0,0},
};


/*******************************************************************************
* Local Variables definition                         
*******************************************************************************/

/*******************************************************************************
* Local Functions prototypes                         
*******************************************************************************/

/*******************************************************************************
*  Global Functions Body                                   
*******************************************************************************/

/**
  * @brief 
  * @param void
  * @retval void
  * @note
  */


